from handler.ftp_receive import FtpReceive
from handler.check_abs import CheckAbs
from handler.decompress import Decompress
from handler.check_file import CheckFile
from handler.import_to_db import ImportDB
from handler.call_sql import CallSql

class App():

    def export(self):
        print 'begin export'
        print 'end export'

    def ftp_send(self):
        print 'begin ftp_send'
        print 'end ftp_send'

    def ftp_receive(self):
        print 'begin ftp_receive'
        self.ftpReceive.handler()
        print 'end ftp_receive'
    def check_abs(self):
        print 'begin check_abs'
        self.checkAbs.handler()
        print 'end check_abs'
        
    def decompress_files(self):
        print 'begin decompress_files'
        self.decompress.handler()
        print 'end decompress_files'
        
    def check_file(self):
        print 'begin check_file'
        self.checkFile.handler()
        print 'end check_file'
        
    def import_to_db(self):
        print 'begin import_to_db'
        self.importDB.handler()
        print 'end import_to_db'
        
    def call_sql(self):
        print 'begin call_sql'
        self.callSql.handler()
        print 'end call_sql'

    def __init__(self):
        self.ftpReceive = FtpReceive()
        self.checkAbs = CheckAbs()
        self.decompress = Decompress()
        self.checkFile = CheckFile()
        self.importDB = ImportDB()
        self.callSql = CallSql()

    def run(self):
       #self.export()
       #self.ftp_send()
       self.ftp_receive()
       self.check_abs()
       self.decompress_files()
       self.check_file()
       self.import_to_db()
       self.call_sql()

def main():
    app = App()
    app.run()
    
if __name__ == '__main__':
    main()
def xxx():
    funs = ['check_abs','decompress','check_file','import_to_db','call_sql']
    for fun in funs:
        print '''
    def {0}(self):
        print 'begin {0}'
        print 'end {0}'
        '''.format(fun)
